package pers.echo.tester;

import com.baomidou.mybatisplus.core.incrementer.IKeyGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import pers.echo.tester.entity.TblBulletins;
import pers.echo.tester.entity.TblCkqinfo;
import pers.echo.tester.entity.Test;
import pers.echo.tester.mapper.TblBulletinsMapper;
import pers.echo.tester.mapper.TblCkqinfoMapper;
import pers.echo.tester.service.ITblBulletinsService;
import pers.echo.tester.service.ITestService;

import javax.annotation.PostConstruct;
import java.math.BigDecimal;
import java.util.List;


@Component
public class MyTest {

    @Autowired(required = false)
    TblCkqinfoMapper mapper;

    @Autowired(required = false)
    TblBulletinsMapper bulletinsMapper;

    @Autowired
    ITblBulletinsService bulletinsService;

    @Autowired
    ITestService testService;

    @Autowired
    IKeyGenerator keyGenerator;

    public void run() {
        List<TblCkqinfo> ckqinfoList = mapper.selectList(null);
        for(TblCkqinfo ckqinfo: ckqinfoList){
            System.out.println(ckqinfo.getFBailtime());
        }
        System.out.println("hello world!");
    }

//    @PostConstruct
    public void generateBulltin(){
        TblBulletins bulletins = bulletinsService.getById(new BigDecimal(38831));
        if(bulletins!=null){
            bulletins.setFWord("测试赣国土资网交矿");
            bulletins.setBulletinid(null);
            boolean flag = bulletinsService.save(bulletins);
            assert(flag);
            if(flag){
                System.out.println(bulletins.getBulletinid());
            }
        }

    }
}
